﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TileViewer
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            renderControl1.Otec = this;
            panel1.Visible = false;
        }

        public int Count
        {
            get { return radioButton1.Checked ? 2 : 4; }
        }

        public bool ShowGrid
        {
            get { return checkBox1.Checked; }
        }

        bool hideHelp = true;

        private void pictureBox1_MouseLeave(object sender, EventArgs e)
        {
            if(hideHelp)panel1.Visible = false;
        }

        private void pictureBox1_MouseEnter(object sender, EventArgs e)
        {
            panel1.Visible = true;
        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {
            hideHelp = !hideHelp;
        }

        private void linkLabel1_Click(object sender, EventArgs e)
        {
            System.Diagnostics.Process.Start("http://vodacekworks.blogspot.com/");
        }

        private void button2_Click(object sender, EventArgs e)
        {
            renderControl1.Center = new Microsoft.Xna.Framework.Vector2(0,0);
            renderControl1.Zoom = 1;
        }

        private void pictureBox2_Click(object sender, EventArgs e)
        {
            DialogResult res=openFileDialog1.ShowDialog();
            if (res == DialogResult.OK)
            {
                renderControl1.LoadTexture(openFileDialog1.FileName);
            }
        }
    }
}
